import {baseAjax} from '../baseAjax'

// 重名判断,信用代码重复判断
export function checkRepeatName (data, successHandle, failHandle) {
  baseAjax('/ent/customer/info/confirm', data, 'post', successHandle, failHandle)
}

// 重名判断,信用代码重复判断promise
export function checkRepeatNamePromise (data) {
  return new Promise((resolve, reject) => {
    checkRepeatName(data, () => { return resolve(true) }, (data) => { return reject(data) })
    // baseAjax('/ent/customer/info/confirm', data, 'post', () => { return resolve(true) }, (data) => { return reject(data) })
  })
}

// 获取来源途径
export function getOriginWay () {
  return [
    {
      id: 1,
      name: '企业考生'
    },
    {
      id: 2,
      name: '考生介绍'
    },
    {
      id: 3,
      name: '公众号'
    },
    {
      id: 4,
      name: '陌生电话'
    },
    {
      id: 5,
      name: '其他'
    }
  ]
}

export const originWay = [
  {
    id: 1,
    name: '企业考生'
  },
  {
    id: 2,
    name: '考生介绍'
  },
  {
    id: 3,
    name: '公众号'
  },
  {
    id: 4,
    name: '陌生电话'
  },
  {
    id: 5,
    name: '其他'
  }
]
